import lazyLoadView from '@/router/lazy-load';

import { AppRouteRecordRaw } from '../types';
import { DEFAULT_LAYOUT } from '../base';

const Customer: AppRouteRecordRaw = {
  path: '/customer', // 路由地址
  name: 'Customer',
  component: DEFAULT_LAYOUT,
  meta: {
    locale: 'menu.customer',
    requiresAuth: false,
    icon: 'icon-settings',
    order: 999,
    roleCode: 'GROUP_SYSTEM_ADMIN',
  }, // 是否显示
  children: [
    {
      path: 'profile', // 路由地址
      name: 'Profile',
      component: lazyLoadView(
        () => import('@/views/customerManagement/customerProfile/index.vue')
      ),
      meta: {
        locale: 'menu.customer.profile',
        requiresAuth: false,
        order: 999,
        roleCode: 'GROUP_SYSTEM_ADMIN',
        pageName: '客户档案',
      }, // 是否显示
    },
    {
      path: 'detail',
      name: 'CustomerDetail',
      meta: {
        locale: 'menu.customer.customerDetail',
        requiresAuth: false,
        roleCode: 'GROUP_SYSTEM_ADMIN',
        hideInMenu: true,
        extra: true,
        layout: 'detail',
      },
      component: lazyLoadView(
        () => import('@/views/customerManagement/customerProfile/detail.vue')
      ),
    },
  ],
};
export default Customer;
